<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/24
 * Time: 21:42
 */

namespace app\api\controller\v1;

use app\api\service\UserToken;
use app\lib\Validate\TokenGetValidate;

class TokenController extends BaseController
{
    public function getToken($code = '')
    {
        (new TokenGetValidate())->goCheck();
        //UserToken
        $wx = new UserToken($code);
        $token = $wx->get();
        return json([
            'token' => $token
        ]);
    }
}